##### Tanu Kumar, Alison Post, Megan Otsuka, Francesc Pardo-Bosch, and Isha Ray. ''From public service access to service quality: The distributive politics of piped water in Bangalore'' ####


#####################
#Datasets and coding#
#####################

############
##'code.R'##
############

This file contains the code needed to create all analytical tables and figures in the paper and online appendix. Note that packages may have to be installed prior to running the code. Users should change the working directory to the location where datasets are stored. For regression tables, output will not be printed until all models are run and the "stargazer" command is called. 


######################
##'final_data.RData'##
######################

This is the dataset used in the analysis in the paper and online appendix. The variable definitions are available below. Unless otherwise specified, variables are measured at the household level. A variable name written as "VA_x" indicates that the variable is the Valve Area level average of variable "x." For example, "VA_urbanmigrant" is the Valve Area level average of "urbanmigrant."

Q213_waterarrival_factor: Survey response to "Does the water ever not come at all on the expected days?" Response options: Yes, rarely, no. Ordinal category such that "no" is the highest level.

Q209_water_time_factor: Survey response to "Does your piped water come at a specific time?" Response options: Yes, no. Ordinal category such that "yes" is the higher level.

Q208_decimal_wateron_factor: Survey response to "Last time the water came, for how many hours was it on?" Response options: Less than 2 hours, 2-3 hours, 3-4 hours, 4+ hours. Ordinal category such that "4+ hours" is the higher level. 

Q205_pipedwaterdays_factor: Survey response to "How many times in a week do you usually receive piped water?" Response options: every 6+ days, every 4-5 days, every 3-4 days, every 2-3 days, every 2 days, everyday. Ordinal category such that "everyday" is the highest level.

Q220a_pressure_factor: Survey response to "How would you describe the pressure of water during supply?" Response options: Weak, moderate, strong. Ordinal category such that "strong" is the highest level.

muslim_family: Binary indicator for whether or not the response to "What is your family's religion" is "Muslim."

low_income_veh: Binary indicator for whether or not a household does NOT report owning any type of motorized vehicle, including a scooter.

low_income: Binary indicator for whether or not a household reports earning less than Rs. 10,000 per month.

SCST2: Binary indicator for whether or not a household reports being a member of a Scheduled Caste or tribe.

cauvery_only: Binary indicator for whether or not a households reports receiving water from the Cauvery water system only

elevation: Elevation of the geographic point at which the household survey was conducted. Captured by tablets used to conduct surveys, estimated with 5m precision.

cmc_supply_only: Binary indicator for whether or not a households reports receiving water from the CMC water system only

urbanmigrant: Binary indicator for whether or not a household has NOT been in Bangalore since the respondent's birth

Q105a_blr_duration: Years in Bangalore for urban migrants

congress: Binary indicator for whether or not the response to "Do you like one political party over others" is "Yes, Congress"

coverage: Description of the survey coverage of a valve area. See SI.II for a description of the coding procedure.

VA_local_leader: Mean number of households in a VA reporting the presence of a local leader in their neighborhood. No household level variable.

Q204_storagetankyesno: An indicator for whether or not a household has an automatically filling tank. A '1" indicates the household has an automatically filling tank, a "2" indicates the household does not have an automatically filling tank, and an "NA" indicates the household does not have any type of water storage tank. 

VA: The Valve Area in which a household is located.

Ward: The Ward in which a household is located

CorporatorAlignmentPre: An indicator for whether or not the ward's corporator is from the Congress party.

comp: The ward-level margin of victory for the 2015 municipal elections in Bangalore.


########################
##'valve_areas' folder##
########################

This folder contains all the shapefiles needed to make the maps in Figure 3 and Figure SI.1.
The "data" slot contains the following variables:

scheduled: Scheduled number of supply days per week as specified by BWSSB.

reported: Modal response in a valve area to "How many times in a week do you usually receive piped water?" Response options: every 6+ days, every 4-5 days, every 3-4 days, every 2-3 days, every 2 days, everyday. Ordinal category such that "everyday" is the highest level.

low.income: fraction of households in a valve area classified as 'low-income' based on not owning any type of motorized vehicle, including a scooter.

muslim: fraction of households in a valve area reporting that the household identifies as "Muslim"






